package Math._478_GenerateRandomPointinaCircle;

public class Solution {
    double radius, x, y;
    public Solution(double radius, double x_center, double y_center) {
        this.radius = radius;
        this.x = x_center;
        this.y = y_center;
    }

    public double[] randPoint() {
        double len = Math.sqrt(Math.random()) * radius;
        double degree = Math.random() * 2 * Math.PI;
        return new double[]{len * Math.cos(degree) + x, len * Math.sin(degree) + y};
    }
}
